﻿/*
 * Copyright(C) 2012,ajayumi 保留所有权利。( All rights reserved. )
 * 
 * 文件名称：CryptoElement.cs
 * 摘    要：
 * 当前版本：1.0
 * 作    者：黄乙冬 (ajayumi)
 * 创建日期：2012年6月9日星期六
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace ajayumi.Platform.Core.Security
{
    /// <summary>
    /// CryptoElement
    /// </summary>
    public class CryptoElement : ConfigurationElement
    {
        [ConfigurationProperty("enabled", DefaultValue = "false", IsRequired = false)]
        public bool Enabled
        {
            get
            {
                return (bool)this["enabled"];
            }
            set
            {
                this["enabled"] = value;
            }
        }

        [ConfigurationProperty("key", DefaultValue = "AABBCCDDEEFF1122", IsRequired = false)]
        public string Key
        {
            get
            {
                return (string)this["key"];
            }
            set
            {
                this["key"] = value;
            }
        }

        [ConfigurationProperty("providerType", DefaultValue = " ajayumi.Platform.Core.Security.DESCryptoProvider, ajayumi.Platform.Core.Security", IsRequired = false)]
        public string ProviderType
        {
            get
            {
                return this["providerType"].ToString();
            }
            set
            {
                this["providerType"] = value;
            }
        }


        [ConfigurationProperty("xmlPublicKey", DefaultValue = "PublicKey.xml", IsRequired = false)]
        public string XmlPublicKey
        {
            get
            {
                return (string)this["xmlPublicKey"];
            }
            set
            {
                this["xmlPublicKey"] = value;
            }
        }

        [ConfigurationProperty("xmlPrivateKey", DefaultValue = "PrivateKey.xml", IsRequired = false)]
        public string XmlPrivateKey
        {
            get
            {
                return (string)this["xmlPrivateKey"];
            }
            set
            {
                this["xmlPrivateKey"] = value;
            }
        }
    }
}
